arm64: dts: qcom: msm8916-asus-z010d: hardware support and panel fix - #450
arm64: dts: qcom: msm8916-asus-z010d: hardware support and panel fix#450FoxWind-coder wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves hardware support for the Qualcomm MSM8916-based Asus Z010D device by adding support for an AP3216C/AP3426 ambient light/proximity sensor, updating the device tree for additional peripherals (charger, sensors, mount matrices), and adjusting the panel bring-up sequence/brightness.
Changes:
- Add a new IIO light driver for Dynaimage AP3216C/AP3426 and wire it into Kconfig/Makefile.
- Update the msm8916-asus-z010d device tree with SMB1360 charger and AP3426 sensor nodes, plus accelerometer mount-matrix adjustments.
- Adjust panel initialization for the Asus Z010D R69339 panel (brightness and sleep/wake sequencing).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| kernel/configs/pmos.config | Enables the new AP3216C driver as a module in the downstream config fragment. |
| drivers/iio/light/Makefile | Adds ap3216c.o to the IIO light drivers build. |
| drivers/iio/light/Kconfig | Introduces CONFIG_AP3216C option for AP3216C/AP3426. |
| drivers/iio/light/ap3216c.c | New AP3216C/AP3426 I2C IIO driver implementation. |
| drivers/gpu/drm/panel/msm8916-generated/panel-asus-z010d-r69339.c | Updates panel on-sequence and initial brightness setting. |
| arch/arm64/boot/dts/qcom/msm8916-asus-z010d.dts | Adds charger/sensor nodes and pinctrl updates for the Asus Z010D device tree. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ac7ee55 to
c64a9e8
Compare
|
|
||
| light-sensor@1e { | ||
| compatible = "dynaimage,ap3426", "dynaimage,ap3216c"; | ||
| reg = <0x1e>; |
There was a problem hiding this comment.
formatting is broken, everywhere
| pinctrl-names = "default"; | ||
| pinctrl-0 = <&smb1360_default>; |
| char *buf) | ||
| { | ||
| /* Default threshold level. Anything above 300 is considered "near" */ | ||
| return sprintf(buf, "300\n"); |
There was a problem hiding this comment.
Unless there's a good reason to hardcode, this should be a device property. The device front glass may be different for different devices for example.
| static int ap3216c_read_raw_data(struct i2c_client *client, u8 reg_low) | ||
| { | ||
| int ret_low, ret_high; | ||
|
|
||
| ret_low = i2c_smbus_read_byte_data(client, reg_low); | ||
| if (ret_low < 0) | ||
| return ret_low; | ||
|
|
||
| ret_high = i2c_smbus_read_byte_data(client, reg_low + 1); | ||
| if (ret_high < 0) | ||
| return ret_high; | ||
|
|
||
| return (ret_high << 8) | ret_low; | ||
| } |
There was a problem hiding this comment.
Is this different from either of i2c_smbus_read_word_{data,swapped}?
|
|
||
| ret = ap3216c_chip_init(client); | ||
| if (ret < 0) { | ||
| dev_err(&client->dev, "Failed to reset chip via I2C\n"); |
There was a problem hiding this comment.
IMO dev_err_probe is always better to use
| { .compatible = "dynaimage,ap3216c" }, | ||
| { } | ||
| }; | ||
| MODULE_DEVICE_TABLE(of, ap3216c_of_match); |
There was a problem hiding this comment.
new dt binding file needs to be added to document those, as a separate commit preceding the implementation.
| }; | ||
| module_i2c_driver(ap3216c_driver); | ||
|
|
||
| MODULE_AUTHOR("Alderpaw <foxy9855@gmail.com>"); |
There was a problem hiding this comment.
upstream maintainers may ask you to use ""real"" name instead of an alias
| CONFIG_RTC_DRV_HID_SENSOR_TIME=m | ||
|
|
||
| # IIO | ||
| CONFIG_AP3216C=m No newline at end of file |
There was a problem hiding this comment.
this should go into msm8916_defconfig
f314d88 to
ef39211
Compare
Signed-off-by: Vladislav Dubrovin <foxy9855@gmail.com>
ef39211 to
1edd42c
Compare
Add support for Dynaimage AP3216C and AP3426 ambient light, proximity and IR sensors connected over I2C. Signed-off-by: Vladislav Dubrovin <foxy9855@gmail.com>
Enable the Dynaimage AP3216C/AP3426 ambient light and proximity sensor driver as a module. Signed-off-by: Vladislav Dubrovin <foxy9855@gmail.com>
Configure the SMB1360 charger on I2C4 and the AP3426 light/proximity sensor on I2C2. Update the mount matrix for the KXTJ21009 accelerometer. Signed-off-by: Vladislav Dubrovin <foxy9855@gmail.com>
…uence Fix an issue where the display remains dark during boot due to an initial brightness value of 0x0001. Set the default boot brightness to 0xffff and add a 20 ms delay before exiting sleep mode to satisfy the Renesas R69339 panel power-on sequence. Signed-off-by: Vladislav Dubrovin <foxy9855@gmail.com>
1edd42c to
dc13bb8
Compare
|
A clarifying question has also come up: I am running kernel 7.0 on msm8916, whereas the official pmaports package linux-postmarketos-qcom-msm8916 uses the LTS kernel 6.12.1. |
This PR brings hardware support improvements for the asus-z010d and fixes display brightness and polarisation bug.
drm/panel: asus-z010d-r69339:
Fixed the initialization sequence. The initial brightness is now set to
0xffff(previously0x0001resulted in a dark screen until backlight takeover). Inserted a necessary 20ms delay prior to exiting sleep mode to meet hardware constraints.iio: light:
Added new driver for the Dynaimage AP3216C/AP3426 ambient light and proximity sensor.
arm64: dts: qcom: msm8916-asus-z010d:
pmos.config:
pinned device photo with working sensors and battery state
Signed-off-by: Alderpaw foxy9855@gmail.com